/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author Mr-Quick
 */
@Entity
@Table(name = "linkImage")
@NamedQueries({
    @NamedQuery(name = "LinkImage.findAll", query = "SELECT l FROM LinkImage l"),
    @NamedQuery(name = "LinkImage.findById", query = "SELECT l FROM LinkImage l WHERE l.id = :id"),
    @NamedQuery(name = "LinkImage.findByLinkImageHouse", query = "SELECT l FROM LinkImage l WHERE l.linkImageHouse = :linkImageHouse")})
public class LinkImage implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private Integer id;
    @Column(name = "linkImageHouse")
    private String linkImageHouse;
    @JoinColumn(name = "idImage", referencedColumnName = "IdHouse")
    @ManyToOne
    private House idImage;

    public LinkImage() {
    }

    public LinkImage(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getLinkImageHouse() {
        return linkImageHouse;
    }

    public void setLinkImageHouse(String linkImageHouse) {
        this.linkImageHouse = linkImageHouse;
    }

    public House getIdImage() {
        return idImage;
    }

    public void setIdImage(House idImage) {
        this.idImage = idImage;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LinkImage)) {
            return false;
        }
        LinkImage other = (LinkImage) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.LinkImage[ id=" + id + " ]";
    }
    
}
